package com.dzsw.order.controller;

import com.dzsw.order.entity.Order;
import com.dzsw.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/query/{orderId}")
    public Order queryOrderById2(@PathVariable("orderId") String orderId) {
        Order order = this.orderService.queryOrderById2(orderId);
        return order;
    }

    @GetMapping("/query1/{orderId}")
    public Order queryOrderById3(@PathVariable("orderId") String orderId) {
        Order order = this.orderService.queryOrderById3(orderId);
        return order;
    }

    @GetMapping("/query2/{orderId}")
    public Order queryOrderById4(@PathVariable("orderId") String orderId) {
        Order order = this.orderService.queryOrderById4(orderId);
        return order;
    }

    @GetMapping("/test")
    public String test() {
        return "ok";
    }
}
